import React, { useEffect, useState } from "react";
import "./index.scss";

const ParseStringToComponent = () => {
  const [option, setOption] = useState({
    name: "lyl",
    age: "24",
  });
  useEffect(() => {
    console.log("触发了effect",option);
  }, [option]);
  return (
    <div className="view">
      <h1 style={{ height: "100vh", lineHeight: "100vh" }}>
        Scroll Div
        <button
          onClick={() => {
            setOption({
              name: "lll",
              age: "25",
            });
          }}
        ></button>
      </h1>
      <div className="content">
        <div className="q"></div>
        <div className="w"></div>
        <div className="e"></div>
        <div className="r"></div>
        <div className="t"></div>
        <div className="y"></div>
        <div className="u"></div>
        <div className="i"></div>
        <div className="o"></div>
        <div className="p"></div>
      </div>
    </div>
  );
};

export default ParseStringToComponent;
